import org.junit.Before;
import org.junit.Test;

import java.io.InputStream;
import java.util.Scanner;

import static org.junit.Assert.*;


public class NGuessNumberTest
{
    @Test
    public void generateAnswerTest()
    {
        int[] number = NGuessNumber.generateAnswer();
        for(int a = 0 ; a<number.length ; a++)
        {
            for(int b = 0 ; b<number.length ; b++)
            {
                if(number[a] == number[b] && a != b && (0<=number[a] && number[a]<=9))
                {
                    System.out.println("generateAnswer()测试未通过");
                    return;
                }
            }
        }
        System.out.println("generateAnswer()测试通过");
    }
    @Test
    public void getPlayerInputTest()
    {
        int[] arr = NGuessNumber.getPlayerInput();
        if(arr.length == 4)
        {
            System.out.println("getPlayerInput()测试通过");
        }
        else
        {
            System.out.println("getPlayerInput()测试未通过");
        }
    }

    @Test
    public void isWinTest()
    {
        boolean[] boolean2 = {true,false,false,true};
        boolean[] boolean1 = {true,true,true,true};
        if(NGuessNumber.isWin() && !NGuessNumber.isWin())
        {
            System.out.println("isWin()测试通过");
        }
        else
        {
            System.out.println("isWin()测试未通过");
        }
    }
}
